package com.allwees.bs.module.lms.track;

import lombok.Data;

/**
 * @author Daniel
 * @version 1.0.0
 * @since 2020/12/21 15:44
 */
@Data
public class MileRequest {
    private String format = "json";
    private String signMethod = "simpleKey";
    private String customerId;
    private String sign;
    private MileParam param;
    private String method;

    private MileRequest(MileParam param, String customerId, String sign) {
        this.param = param;
        this.customerId = customerId;
        this.sign = sign;
    }

    public static MileRequest newTrackRequest(MileParam param, String customerId, String sign) {
        MileRequest mileRequest = new MileRequest(param, customerId, sign);
        mileRequest.setMethod("trackOrderOneByOne");
        return mileRequest;
    }

    public static MileRequest newCreateRequest(MileParam param, String customerId, String sign) {
        MileRequest mileRequest = new MileRequest(param, customerId, sign);
        mileRequest.setMethod("createOrder");
        return mileRequest;
    }

    public static MileRequest newReprintRequest(MileParam param, String customerId, String sign) {
        MileRequest mileRequest = new MileRequest(param, customerId, sign);
        mileRequest.setMethod("reprintOrder");
        return mileRequest;
    }
}
